<?php
//
// +----------------------------------------------------------------------+
// |zen-cart Open Source E-commerce                                       |
// +----------------------------------------------------------------------+
// | Copyright (c) 2003 The zen-cart developers                           |
// |                                                                      |
// | http://www.zen-cart.com/index.php                                    |
// |                                                                      |
// | Portions Copyright (c) 2003 osCommerce                               |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the GPL license,       |
// | that is bundled with this package in the file LICENSE, and is        |
// | available through the world-wide-web at the following url:           |
// | http://www.zen-cart.com/license/2_0.txt.                             |
// | If you did not receive a copy of the zen-cart license and are unable |
// | to obtain it through the world-wide-web, please send a note to       |
// | license@zen-cart.com so we can mail you a copy immediately.          |
// +----------------------------------------------------------------------+
//
// ===============================================================================
// Add-On: Envios List v1.0
// Designed for: Zen Cart 1.3.x series
// Created by: Fredie Auditor (http://www.sharedterminl.info)
//
// Donations:  Please support Zen Cart!  paypal@zen-cart.com  - Thank you!
// ===============================================================================
require('includes/application_top.php');
if (isset($_POST['txtAssigned']) || isset($_POST['Update']) 
            || isset($_POST['Attach']) 
            || isset($_POST['AttachSEUR']) 
            || isset($_POST['AttachEntregues'])
            || isset($_POST['AttachEntreguesCOD'])) {  
    require('includes/templates/tpl_batch_processing.php');
    if($_POST['txtAssigned'] != ''){
        if($flag) $messageStack->add('Assign Finished.', 'success');
        else $messageStack->add('Assign Failed.', 'error');
    }
    else if(isset($_POST['Update']))
    {
        if($flag) $messageStack->add('Update Orders Finished.', 'success');
        else $messageStack->add('Update Orders Failed.', 'error');
    }
    else if(isset($_POST['Attach']))
    {
        $arrMsg = explode(";", $message);        
        if($arrMsg[0] != '') $messageStack->add($arrMsg[0], 'success');
        if($arrMsg[1] != '') $messageStack->add($arrMsg[1], 'error');
    }
    else if(isset($_POST['AttachSEUR']))
    {
        $arrMsg = explode(";", $message);        
        if($arrMsg[0] != '') $messageStack->add($arrMsg[0], 'success');
        if($arrMsg[1] != '') $messageStack->add($arrMsg[1], 'error');
    }
    else if(isset($_POST['AttachEntregues']))
    {
        $arrMsg = explode(";", $message);        
        if($arrMsg[0] != '') $messageStack->add($arrMsg[0], 'success');
        if($arrMsg[1] != '') $messageStack->add($arrMsg[1], 'error');
    }
    else if(isset($_POST['AttachEntreguesCOD']))
    {
        $arrMsg = explode(";", $message);        
        if($arrMsg[0] != '') $messageStack->add($arrMsg[0], 'success');
        if($arrMsg[1] != '') $messageStack->add($arrMsg[1], 'error');
    }
} //else 
{
    
}

?>

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title>Batch Processing</title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<link rel="stylesheet" type="text/css" href="includes/cssjsmenuhover.css" media="all" id="hoverJS">
<script language="javascript" src="includes/menu.js"></script>
<script language="javascript" src="includes/general.js"></script>
<script type="text/javascript">
  <!--
  function init()
  {
    cssjsmenu('navbar');
    if (document.getElementById)
    {
      var kill = document.getElementById('hoverJS');
      kill.disabled = true;
    }
  }
  // -->
</script>
</head>
<body onLoad="init()">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="2" cellpadding="2">
  <tr>
<!-- body_text //-->

    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td class="pageHeading">Assign Tracking Number to Order</td>
            <td class="pageHeading" align="right"><?php echo zen_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td>                  
          <form style="margin-left: 20px;" action="batch_processing.php" method="post">
            <div style="width: 30%"><textarea name="txtAssigned" id="txtAssigned" cols="3" rows="10"></textarea></div>
            <div><input type="submit" id="btnAssign" onclick="return validate();" value="Assign" />
                &nbsp;<input type="submit" id="btnUpdate" name="Update" value="Update Orders Processing" />
            </div>
          </form>
          <form action="batch_processing.php" method="post" enctype="multipart/form-data">
            <h1>Processar pagamentos Multibanco</h1>
            <div>
                <input type="file" name="attach_file" size="50" />
                &nbsp;<input type="submit" value="Submit" name="Attach" />
            </div>
          </form>
          <form action="batch_processing.php" method="post" enctype="multipart/form-data">
            <h1>Processar ficheiro upload de tracking CTTEXPRESSO/SEUR</h1>
            <div>
                <input type="file" name="attach_file" size="50" />
                &nbsp;<input type="submit" value="Submit" name="AttachSEUR" />
            </div>
          </form>
          <form action="batch_processing.php" method="post" enctype="multipart/form-data">
            <h1>Processar pagamentos Entregueso</h1>
            <div>
                <input type="file" name="attach_file" size="50" />
                &nbsp;<input type="submit" value="Submit" name="AttachEntregues" />
            </div>
          </form>
          <form action="batch_processing.php" method="post" enctype="multipart/form-data">
            <h1>Processar pagamentos Entregueso (Cash on delivery)</h1>
            <div>
                <input type="file" name="attach_file" size="50" />
                &nbsp;<input type="submit" value="Submit" name="AttachEntreguesCOD" />
            </div>
          </form>
        </td>
      </tr>
    </table></td>

<!-- body_text_eof //-->
  </tr>
</table>
<!-- body_eof //-->
<script type="text/javascript">
function validate()
{
    var txt = document.getElementById('txtAssigned');
    if(txt.value=='')
     {
         alert('Please input the data');
         txt.focus();
         return false;         
     }
     return true;
}
</script>
<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php

require(DIR_WS_INCLUDES . 'application_bottom.php');


?>